var t = require;
var e = module;
var o = exports;
var n =
    (this && this.__extends) ||
    (function() {
        var t = function(e, o) {
            return (t =
                Object.setPrototypeOf ||
                ({ __proto__: [] }
                    instanceof Array &&
                    function(t, e) {
                        t.__proto__ = e;
                    }) ||
                function(t, e) {
                    for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                })(e, o);
        };
        return function(e, o) {
            function n() {
                this.constructor = e;
            }
            t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
        };
    })(),
    r =
    (this && this.__decorate) ||
    function(t, e, o, n) {
        var r,
            a = arguments.length,
            i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
        else
            for (var s = t.length - 1; s >= 0; s--)
                (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
        return a > 3 && i && Object.defineProperty(e, o, i), i;
    };
Object.defineProperty(o, "__esModule", { value: !0 });
var a = t("EventData"),
    i = t("GameData"),
    s = t("View"),
    c = t("ConfS"),
    l = t("fightManager"),
    u = t("selectchapter"),
    p = require("./关卡详情"),
    f = cc._decorator,
    d = f.ccclass,
    h =
    (f.property,
        (function(t) {
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                return (e.res = "selectfuben"), (e.data = new a.default(o.data)), e;
            }
            var o;
            return (
                n(e, t),
                (o = e),
                (e.prototype.view_item = function(t, e, o) {
                    var n = e.chapterList[o];
                    i.default.fubens.includes(n) ?
                        (t.index = 0) :
                        0 == o ?
                        ((t.index = 1), (this.find("sk").x = t.node.x), (this.find("sk").y = t.node.y)) :
                        i.default.fubens.includes(e.chapterList[o - 1]) ?
                        ((t.index = 1), (this.find("sk").x = t.node.x), (this.find("sk").y = t.node.y)) :
                        (t.index = 2);
                }),
                (e.prototype.view_item0 = function(t, e) {
                    (this.find("sk").x = 0), (this.find("sk").y = 500), this.view_item(t, e, 0);
                }),
                (e.prototype.view_item1 = function(t, e) {
                    this.view_item(t, e, 1);
                }),
                (e.prototype.view_item2 = function(t, e) {
                    this.view_item(t, e, 2);
                }),
                (e.prototype.view_item3 = function(t, e) {
                    this.view_item(t, e, 3);
                }),
                (e.prototype.view_item4 = function(t, e) {
                    this.view_item(t, e, 4);
                }),
                (e.prototype.view_item5 = function(t, e) {
                    this.view_item(t, e, 5);
                }),
                (e.prototype.onClick = function(t, e) {
                    switch (t) {
                        case "close":
                            this.hideView(), this.showView(u.default);
                            break;
                        default:
                            if (t.includes("item")) {
                                var o = parseInt(t.slice(4)),
                                    n = this.data.value.chapterList[o];
                                if (0 == o) this.gofight(n);
                                else if (i.default.fubens.includes(n)) this.gofight(n);
                                else {
                                    var r = this.data.value.chapterList[o - 1];
                                    i.default.fubens.includes(r) && this.gofight(n);
                                }
                            }
                    }
                }),
                (e.prototype.gofight = function(t) {
                    (l.default.fubendata = c.DatasManager.FubenDatasById[t]),
                    (l.default.mapdata = c.DatasManager.DituDatasById[l.default.fubendata.map]),
                    this.showView(p.default);
                }),
                (e = o = r([d], e))
            );
        })(s.default));
o.default = h;